package com.starsky.project.controller;


import com.starsky.project.service.WordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@Api(description = "word基本操作")
@RestController
public class WordController {

    @Autowired
    private WordService wordService;

    /**
     * 简单导出没有图片和Excel
     */
    @ApiOperation("简单导出没有图片和Excel")
    @PostMapping(value = "/simpleWordExport")
    public void simpleWordExport(HttpServletResponse response) {
        wordService.simpleWordExport(response);
    }


    /**
     * 导出带表格的word
     */
    @ApiOperation("导出带表格的word")
    @PostMapping(value = "/exportTableWord")
    public void exportTableWord(HttpServletResponse response) {
        wordService.exportTableWord(response);
    }


    /**
     * 文件流模版导出word
     */
    @ApiOperation("文件流模版导出word")
    @PostMapping(value = "/exportWord07")
    public void exportWord07(HttpServletResponse response) {
        wordService.exportWord07(response);
    }

    /**
     * 导出单个压缩文件
     */
    @ApiOperation("导出单个压缩文件")
    @PostMapping(value = "/exportSimpleWord07Zip")
    public void exportSimpleWord07Zip() {
        wordService.exportSimpleWord07Zip();
    }

    /**
     * 导出压缩文件
     */
    @ApiOperation("导出压缩文件")
    @PostMapping(value = "/exportWord07Zip")
    public void exportWord07Zip(HttpServletResponse response) {
        wordService.exportWord07Zip(response);
    }

    /**
     * 导出多个word压缩文件
     */
    @ApiOperation("导出多个word压缩文件")
    @PostMapping(value = "/exportMutilWord07Zip2")
    public void exportMutilWord07Zip2(HttpServletResponse response) {
        wordService.exportMutilWord07Zip2(response);
    }

}
